<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>apply</title>

    <!--<script src="../static/js/jquery-1.9.1.min.js"></script>-->

    <script src="/static/js/jquery-1.9.1.min.js"></script>
    <script th:src="@{/js/jquery-1.9.1.min.js}"></script>
    <script src="/static/js/bootstrap.js"></script>
    <script th:src="@{/js/bootstrap.js}"></script>

    <link rel="stylesheet" href="/static/css/bootstrap.css">
    <link rel="stylesheet" th:href="@{/css/bootstrap.css}">

    <style>
        body{
            padding: 50px;
        }
    </style>
</head>


<script>

    $(document).ready(function () {

        $("#s11").change(function () {

            var shengId = $("#s11").val();
            console.log(shengId)
            if (shengId == '') {
                return;
            }
            $.ajax({
                cache: false,
                type: 'get',
                url: 'http://localhost:8080/shi/getShiList/' + shengId,
                //data: {'id': shengId},
                success: function (data) {
                    console.log(data)
                    var shiId = $("#s22").empty()
                    for (var i = 0; i < data.data.length; i++){
                        shiId.append("<option value='" + data.data[i].id + "'>"+data.data[i].name + "</option>")
                    }
                }
            })

        });


        // ----
        // $("#s3,#s4").change(function () {
        //
        //     var city1 = $("#s3").val()
        //     var city2 = $("#s4").val()
        //     // var a = $("#city").html(city1+city2)
        //     // console.log(a)
        // })
        //
        // $("#s5").change(function () {
        //
        //     var paizi = $("#s5").val()
        //     console.log(paizi)
        //
        // })






    })






</script>


<body>

<div>
    <div>
        <p th:text="${msg}" style="color: red">apply</p>
    </div>
    <div>
        <form class="form-horizontal" th:action="@{apply}" method="post" role="form">

            <div class="form-group">

                <label class="col-sm-5 control-label">姓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;名: </label>
                <p class="col-sm-2">
                    <input type="text" class="form-control" id="1" name="name" placeholder="请输入">
                </p>
                <label class="col-sm-4 control-label"></label>
                <p class="col-sm-12">
                    <input type="hidden" class="form-control" id="11" placeholder="请输入">
                </p>


                <label class="col-sm-5 control-label">常&nbsp;&nbsp;住&nbsp;&nbsp;地: </label>
                <p class="col-sm-2">
                    <select class="form-control" id="s11" name="shengId">
                        <option value="#">请选择常用居住地</option>
                        <option value="#" th:each="sheng:${shengList}"
                                th:value="${sheng.id}">[[${sheng.name}]]</option>
                    </select>
                    <select class="form-control" name="shiId" id="s22">
                        <option value="#">请选择</option>
                        <!--<option value="#"></option>-->
                    </select>
                    <!--<input type="text" class="form-control" id="2" placeholder="请输入">-->
                </p>
                <label class="col-sm-4 control-label"></label>
                <p class="col-sm-12">
                    <input type="hidden" class="form-control" placeholder="请输入">
                </p>

                <label class="col-sm-5 control-label">上牌城市: </label>
                <p class="col-sm-2">
                    <select class="form-control" name="1">
                        <option value="">--请选择--</option>
                        <option value="京" pid="1">京</option>
                        <option value="沪" pid="2">沪</option>
                        <option value="津" pid="3">津</option>
                        <option value="渝" pid="4">渝</option>
                        <option value="浙" pid="5">浙</option>
                        <option value="苏" pid="6">苏</option>
                        <option value="粤" pid="7">粤</option>
                        <option value="闽" pid="8">闽</option>
                        <option value="湘" pid="9">湘</option>
                        <option value="鄂" pid="10">鄂</option>
                        <option value="辽" pid="11">辽</option>
                        <option value="吉" pid="12">吉</option>
                        <option value="黑" pid="13">黑</option>
                        <option value="冀" pid="14">冀</option>
                        <option value="豫" pid="15">豫</option>
                        <option value="鲁" pid="16">鲁</option>
                        <option value="陕" pid="17">陕</option>
                        <option value="甘" pid="18">甘</option>
                        <option value="晋" pid="21">晋</option>
                        <option value="川" pid="22">川</option>
                        <option value="贵" pid="23">贵</option>
                        <option value="皖" pid="24">皖</option>
                        <option value="赣" pid="25">赣</option>
                        <option value="云" pid="26">云</option>
                        <option value="蒙" pid="27">蒙</option>
                        <option value="桂" pid="28">桂</option>
                        <option value="琼" pid="31">琼</option>
                        <option value="新" pid="20">新</option>
                        <option value="藏" pid="29">藏</option>
                        <option value="青" pid="19">青</option>
                        <option value="宁" pid="30">宁</option>
                    </select>
                    <select class="form-control" name="2">
                        <option value="">--请选择--</option>
                        <option value="A">A</option>
                        <option value="B">B</option>
                        <option value="C">C</option>
                        <option value="D">D</option>
                        <option value="E">E</option>
                        <option value="F">F</option>
                        <option value="G">G</option>
                        <option value="H">H</option>
                        <option value="I">I</option>
                        <option value="J">J</option>
                        <option value="K">K</option>
                        <option value="L">L</option>
                        <option value="M">M</option>
                        <option value="N">N</option>
                        <option value="O">O</option>
                        <option value="P">P</option>
                        <option value="Q">Q</option>
                        <option value="R">R</option>
                        <option value="S">S</option>
                        <option value="T">T</option>
                        <option value="U">U</option>
                        <option value="V">V</option>
                        <option value="W">W</option>
                        <option value="X">X</option>
                        <option value="Y">Y</option>
                        <option value="Z">Z</option>
                    </select>
                    <!--<input type="text" class="form-control" id="3" placeholder="请输入">-->
                </p>
                <label class="col-sm-4 control-label"></label>
                <p class="col-sm-12">
                    <input type="hidden" class="form-control"  placeholder="请输入">
                </p>

                <label class="col-sm-5 control-label">车辆品牌: </label>
                <p class="col-sm-2">
                    <select class="form-control" name="paizi">
                        <option value="#">请选择</option>
                        <option value="#" th:each="car:${carList}" th:value="${car.name}">[[${car.name}]]</option>
                    </select>
                </p>
                <label class="col-sm-4 control-label"></label>
                <p class="col-sm-12">
                    <input type="hidden" class="form-control"  placeholder="请输入">
                </p>

                <label class="col-sm-5 control-label">申请额度: </label>
                <p class="col-sm-2">
                    <input type="radio" name="money" value="10">&nbsp;10万以下&nbsp;&nbsp;
                    <input type="radio" name="money" value="30">&nbsp;10-30万&nbsp;&nbsp;
                    <input type="radio" name="money" value="50">&nbsp;30万以上&nbsp;&nbsp;
                </p>
                <label class="col-sm-4 control-label"></label>
                <p class="col-sm-12">
                    <input type="hidden" class="form-control"  placeholder="请输入">
                </p>

                <label class="col-sm-5 control-label">手&nbsp;&nbsp;机&nbsp;&nbsp;号: </label>
                <p class="col-sm-2">
                    <input type="text" class="form-control" id="5" name="mobile" placeholder="请输入">
                </p>
                <label class="col-sm-4 control-label"></label>
                <p class="col-sm-12">
                    <input type="hidden" class="form-control" placeholder="请输入">
                </p>

                <label class="col-sm-5 control-label">证件类型: </label>
                <p class="col-sm-2">
                    <input type="text" class="form-control" id="6" name="sfzh" placeholder="请输入">
                </p>
                <label class="col-sm-4 control-label"></label>
                <p class="col-sm-12">
                    <input type="hidden" class="form-control"  placeholder="请输入">
                </p>

                <label class="col-sm-5 control-label"></label>
                <p class="col-sm-1">
                    <input type="submit" class="form-control btn btn-primary" id="7" value="立即申请" placeholder="请输入">
                </p>

            </div>
        </form>
    </div>


</div>
</body>
</html>